# This file is expected to be run during installation

if(${WIN32})
    message(STATUS "Running windeployqt for @AppName@ ...")
    execute_process(
        COMMAND "@SlopeCraft_Qt_windeployqt_executable@" "@AppName@.exe"
        WORKING_DIRECTORY "@CMAKE_INSTALL_PREFIX@"
        OUTPUT_QUIET
        COMMAND_ERROR_IS_FATAL ANY)

    message(STATUS "Current directory: ${CMAKE_CURRENT_SOURCE_DIR}")

    return()
endif()

if(${LINUX})
    return()
endif()

if(${APPLE})
    message(STATUS "Running macdeployqt for @AppName@ ...")
    execute_process(
        COMMAND "@SlopeCraft_Qt_macdeployqt_executable@" "@AppName@.app"
        WORKING_DIRECTORY "@CMAKE_INSTALL_PREFIX@"
        OUTPUT_QUIET
        COMMAND_ERROR_IS_FATAL ANY)

    return()
endif()